/*
 *  application：
 *  1.线上互动      wx6bc98c30de344937 | d5da036f72fcf37ddba7ef79bac3623c | 403  | 503  | https://o2o.yimidh.com/#/login?env=1
 *  2.话题互动      wxfece8345a2eee85b | 4d54781da7f79079b957172f7e9395aa | 404  | 504  | https://hthd.yimidh.com/#/login?env=1
 *  3.明星互动      wx9bce6571394d4947 | 961761be3e3db5fc8489e64c958f6ec9 | 400  | 500  | https://mxhd.yimidh.com/#/login?env=1
 *  4.网上课堂      wxbbd6d2de4c350f5a | 0c9677f1e806770a474e25bfef703f91 | 401  | 501  | https://wskt.yimidh.com/#/login?env=1
 *  5.现场互动      wxef9cbb739cb0ed77 | 061d530e08ac425cd8807d6662f8f687 | 402  | 502  | https://xcsmhd.yimidh.com/#/login?env=1
 *  6.兴趣沙龙      wxcf08b5b56205647f | 67e9d37d7158c801bc4c048b6e227fc2 | 405  | 505  | https://xqslhd.yimidh.com/#/login?env=1
 *  7.校园互动      wxa365539e7593c497 | 3c4bcd23767f4a3504e572df43c92799 | 406  | 506  | https://xyhd.yimidh.com/#/login?env=1
 *  8.线上办公      wxf56e436093d11e25 | 9c8d388a28e76a57392bf22b8a711456 | 408  | 508  | https://xsbg.yimidh.com/#/login?env=1
 *  9.线上教育      wx786259ea5d3d5dea | f76c293dd2badd9eb65d57e51d9aaf47 | 409  | 509  | https://xsjy.yimidh.com/#/login?env=1
 * 10.附近玩吧      wx021a930bebfc0daa | abaa00a30b8fd0682b6f9583e79a652c | 407  | 507  | https://fjwb.yimidh.com/#/login?env=1
 * 11.网上互动      wxa2a78071ac5db945 | 1e246f8350497dd5f47cfc62fa0de815 | 4010 | 5010 | https://wshd.yimidh.com/#/login?env=1
 *  
 */
let locale = false;
let experience = false;
let application = 1;
let https = null;
let wss = null;
let theme = {};
//1-prod;2-exp
let env=1;
if (application == 1) {
  // 线上互动
  https = experience ? 'https://o2otest.yimidh.com' : 'https://o2o.yimidh.com';
  wss = experience ? 'wss://o2otest.yimidh.com' : 'wss://o2o.yimidh.com';
  theme = {
    wechatLogo: 'iteraction_wechat_logo.png',
    wechatName: '线上互动',
    shortName: '节目',
    indexShareTitle: '线上互动，边看电视边吐槽'
  }
} else if (application == 2) {
  // 话题互动
  https = experience ? 'https://hthdtest.yimidh.com' : 'https://hthd.yimidh.com';
  wss = experience ? 'wss://hthdtest.yimidh.com' : 'wss://hthd.yimidh.com';
  theme = {
    wechatLogo: 'hthd_wechat_logo.png',
    wechatName: '话题互动',
    shortName: '话题',
    indexShareTitle: '话题互动=热门话题+互联网'
  }
} else if (application == 3) {
  // 明星互动
  https = experience ? 'https://mxhdtest.yimidh.com' : 'https://mxhd.yimidh.com';
  wss = experience ? 'wss://mxhdtest.yimidh.com' : 'wss://mxhd.yimidh.com';
  theme = {
    wechatLogo: 'mxhd_wechat_logo.png',
    wechatName: '明星互动',
    shortName: '明星',
    indexShareTitle: '明星互动，明星与粉丝聊天'
  }
} else if (application == 4) {
  // 网上课堂
  https = experience ? 'https://wskttest.yimidh.com' : 'https://wskt.yimidh.com';
  wss = experience ? 'wss://wskttest.yimidh.com' : 'wss://wskt.yimidh.com';
  theme = {
    wechatLogo: 'wskt_wechat_logo.png',
    wechatName: '网上课堂简易版',
    shortName: '网课',
    indexShareTitle: '网上课堂'
  }
} else if (application == 5) {
  // 现场互动
  https = experience ? 'https://xcsmhdtest.yimidh.com' : 'https://xcsmhd.yimidh.com';
  wss = experience ? 'wss://xcsmhdtest.yimidh.com' : 'wss://xcsmhd.yimidh.com';
  theme = {
    wechatLogo: 'xcsmhd_wechat_logo.png',
    wechatName: '现场互动',
    shortName: '现场',
    indexShareTitle: '现场互动=聚会现场+互联网'
  }
} else if (application == 6) {
  // 兴趣沙龙
  https = experience ? 'https://xqslhdtest.yimidh.com' : 'https://xqslhd.yimidh.com';
  wss = experience ? 'wss://xqslhdtest.yimidh.com' : 'wss://xqslhd.yimidh.com';
  theme = {
    wechatLogo: 'xqslhd_wechat_logo.png',
    wechatName: '兴趣沙龙',
    shortName: '兴趣',
    indexShareTitle: '兴趣沙龙=兴趣爱好+互联网'
  }
} else if (application == 7) {
  // 校园互动
  https = experience ? 'https://xyhdtest.yimidh.com' : 'https://xyhd.yimidh.com';
  wss = experience ? 'wss://xyhdtest.yimidh.com' : 'wss://xyhd.yimidh.com';
  theme = {
    wechatLogo: 'xyhd_wechat_logo.png',
    wechatName: '校园互动',
    shortName: '校园',
    indexShareTitle: '校园互动'
  }
} else if (application == 8) {
  // 线上办公
  https = experience ? 'https://xsbgtest.yimidh.com' : 'https://xsbg.yimidh.com';
  wss = experience ? 'wss://xsbgtest.yimidh.com' : 'wss://xsbg.yimidh.com';
  theme = {
    wechatLogo: 'xsbg_wechat_logo.png',
    wechatName: '线上办公',
    shortName: '办公',
    indexShareTitle: '线上办公'
  }
} else if (application == 9) {
  // 线上教育
  https = experience ? 'https://xsjytest.yimidh.com' : 'https://xsjy.yimidh.com';
  wss = experience ? 'wss://xsjytest.yimidh.com' : 'wss://xsjy.yimidh.com';
  theme = {
    wechatLogo: 'xsjy_wechat_logo.png',
    wechatName: '线上教育',
    shortName: '教育',
    indexShareTitle: '线上教育'
  }
} else if (application == 10) {
  // 附近玩吧
  https = experience ? 'https://fjwbtest.yimidh.com' : 'https://fjwb.yimidh.com';
  wss = experience ? 'wss://fjwbtest.yimidh.com' : 'wss://fjwb.yimidh.com';
  theme = {
    wechatLogo: 'fjwb_wechat_logo.png',
    wechatName: '附近玩吧',
    shortName: '玩吧',
    indexShareTitle: '附近玩吧'
  }
} else if (application == 11) {
  // 网上互动
  https = experience ? 'https://wshdtest.yimidh.com' : 'https://wshd.yimidh.com';
  wss = experience ? 'wss://wshdtest.yimidh.com' : 'wss://wshd.yimidh.com';
  theme = {
    wechatLogo: 'wshd_wechat_logo.png',
    wechatName: '网上互动',
    shortName: '节目',
    indexShareTitle: '网上互动'
  }
}

var host = locale ? 'http://localhost:8085' : https;
var ws = locale ? 'ws://localhost:8085' : wss;

var config = {
  locale,
  application,
  env,
  theme,
  // 下面的地址配合云端 Demo 工作
  service: {
    host,
    /**
     * UserController interface
     */
    // 获取游客uuid，用于建立会话
    uuidUrl: `${host}/api/user/getUuid?env=${env}`,
    // 登录地址，用于建立会话
    loginUrl: `${host}/api/user/loginForMobile?env=${env}`,
    //获取更多消息
    updateLastVisitPageUrl: `${host}/api/user/updateLastVisitPage?env=${env}`,
    //注册为发布者
    regToPublisherUlr: `${host}/api/user/regToPublisher?env=${env}`,
    //更新个人信息
    updateUserInfoUrl: `${host}/api/user/updateUserInfo?env=${env}`,
    //更新个人信息
    updateUserAvatarInfoUrl: `${host}/api/user/updateUserAvatar?env=${env}`,
    //获取手机验证码
    getMobileCodeUrl: `${host}/api/user/getMobileCode?env=${env}`,
    //统计粉丝数量
    countFansUrl: `${host}/api/user/countFans?env=${env}`,
    //订阅互动
    subscribeProgramUrl: `${host}/api/user/subscribeProgram?env=${env}`,
    //取消订阅
    cancelSubscribeProgramUrl: `${host}/api/user/cancelSubscribeProgram?env=${env}`,
    //根据微信id获取用户
    getUserInfoByAccountUrl: `${host}/api/user/getUserInfoByAccount?env=${env}`,
    //获取用户列表
    getUserListUrl: `${host}/api/user/getUserList?env=${env}`,
    //批量修改用户角色
    batchUpdateUserRoleUrl: `${host}/api/user/updateUserToNormalAdminUser?env=${env}`,
    //更新离线消息订阅
    updateNoticeSubUrl: `${host}/api/user/noticeSub`,

    /**
     * ProgramController interface
     */
    //下架互动
    closeProgramUrl: `${host}/api/program/closeProgram?env=${env}`,
    //编辑互动
    editProgramUrl: `${host}/api/program/saveProgram?env=${env}`,
    //删除互动
    delProgramUrl: `${host}/api/program/delProgram?env=${env}`,
    //获取互动详情
    getProgramInfoUrl: `${host}/api/program/getProgramInfo?env=${env}`,
    //获取订阅的互动
    getSubscribeProgramListUrl: `${host}/api/program/getSubscribeProgramList?env=${env}`,
    //获取热门互动
    getHotProgramListUrl: `${host}/api/program/getHotProgramsList?env=${env}`,
    //保存互动
    saveProgramUrl: `${host}/api/program/saveProgram?env=${env}`,
    //获取自己发布互动的列表
    getPublishProgramListUrl: `${host}/api/program/getPublish?env=${env}`,
    //管理员获取待审核的列表
    getAuditProgramListUrl: `${host}/api/program/getAuditProgramListUrl?env=${env}`,
    //审核互动
    auditProgramUrl: `${host}/api/program/auditProgram?env=${env}`,

    /**
     * CategoryController interface
     */
    //获取分类列表
    getCategoryListUrl: `${host}/api/category/list?env=${env}`,
    //分类点击量+1
    updateCategoryClickCountUrl: `${host}/api/category/increaseClick?env=${env}`,
    //小程序点击量+1
    updateMiniProgramClickCountUrl: `${host}//api/guideWechat/increaseClick?env=${env}`,

    /**
     * MessageController interface
     */
    // 分页获取聊天消息记录
    getPagingMessages: `${host}/api/msg/getMessages?env=${env}`,
    // 更新已读语音消息
    updateReadVoiceMessageUrl: `${host}/api/msg/updateReadVoiceMessage?env=${env}`,

    /**
     * FileController interface
     */
    //获取文件
    getFile: `${host}/api/file/getFile?env=${env}`,
    //上传文件
    uploadFileUrl: `${host}/api/file/upload?env=${env}`,

    /**
     * subscribe interface
     */
    //获取文件
    sendSubMessage: `${host}/api/wx/send?env=${env}`,

    /**
     * WebSocket Server
     */
    //消息通道
    tunnelUrl: `${ws}/api/socketServer`
  }
};

module.exports = config;
